home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Mac Game Programming Gurus
/
TricksOfTheMacGameProgrammingGurus.iso
/
More Source
/
Libraries
/
VideoToolbox 95.04.18
/
VideoToolboxSources
/
Log2L.c
< prev
next >
Wrap
Text File
|
1993-02-23
|
347b
|
20 lines
/*
Log2L.c
HISTORY:
12/3/91 dgp changed zero argument return from -1 to LONG_MIN.
*/
#include "VideoToolbox.h"
long Log2L(unsigned long j)
// returns the integer part of log2(j)
{
long L=-1;
register unsigned long i=j; // Because THINK C won't put arguments into registers
if(i==0)return LONG_MIN;
while(i>0){
i>>=1;
L++;
}
return L;
}